import { Column, Entity, ManyToOne, JoinColumn } from 'typeorm'
import { Admin } from 'src/modules/admin/entities/admin.entity'
import { App } from 'src/app.entity'
import { NoticeEnum } from 'src/types/notice'
@Entity()
export class Notice extends App {
  @Column({ type: 'varchar', length: 20 })
  title: string
  @Column({ type: 'varchar' })
  content: string
  @Column({ type: 'varchar', length: 20 })
  date: string
  @ManyToOne(() => Admin)
  @JoinColumn({ name: 'admin_id' })
  admin: Admin
  @Column({ type: 'enum', enum: NoticeEnum, default: NoticeEnum['暂存'] })
  status: NoticeEnum
}
